<!DOCTYPE html>
<html lang="zh-Hans-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>问答</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="zhz">
    <meta name="time" content="2022/4/17">
    <link href="/static/img/favicon.ico" rel="shortcut icon">
    <link href="../../static/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="../../static/css/my/common/modal.css" rel="stylesheet">
    <link href="../../static/css/my/qAndA.css" rel="stylesheet">
    <link href="../../static/css/my/common/header.css" rel="stylesheet">
    <link href="../../static/css/my/common/default.css" rel="stylesheet">
</head>
<body>

<div class="myContainer">
    <div th:replace="~{common/header}"></div>
    <main id="main" class="w-100 d-flex justify-content-center align-items-center">
        <div class="qAndA d-flex">
            <div class="contents overflow-auto"><!--展示用户问答界面-->
                <div th:each="qAndA:${qAndAs}" class="aQAndA"><!--遍历输出-->
                    <div class="head d-flex align-items-center">
                        <img th:src="${qAndA.getString('questionerHeadPortrait')}"
                             th:onclick="'window.location.href = ' + '\'' + '/userFriendProfile/' + ${qAndA.getIntValue('questionerId')} + '\''"
                             title="点击查看Ta的资料" class="rounded-circle" alt="" width="35" height="35">
                        <span th:text="${qAndA.getString('questionerName')}" title="点击查看Ta的资料"
                              th:onclick="'window.location.href = ' + '\'' + '/userFriendProfile/' + ${qAndA.getIntValue('questionerId')} + '\''">
                        </span>
                        <span class="time" style="margin-left: auto" th:text="${qAndA.getLongValue('questionTime')}">
                        </span>
                    </div>
                    <div class="mainContent">
                        <span th:text="${qAndA.getString('question')}" class="d-flex"></span>
                    </div>
                    <div class="footer d-flex justify-content-end">
                        <input type="hidden" th:value="${qAndA.getIntValue('questionId')}">
                        <input type="hidden" value="0">
                        <img onclick="showAnswerModal(this)" src="../../static/img/answer.svg" title="回答"
                             alt="" height="20" width="20">
                        <img onclick="moreInfoOfThisQuestion(this)" src="../../static/img/loadMore.svg" title="查看详情"
                             alt="" height="20" width="20">
                    </div>
                </div>
                <div id="pagination" class="pagination pagination-sm d-flex justify-content-center align-items-center">
                    <input th:value="${totalPages}" id="totalPages" type="hidden"><!--总页数、当前页、当前请求路径-->
                    <input th:value="${currentPage}" id="currentPage" type="hidden">
                    <input th:value="${currentPath}" id="currentPath" type="hidden">
                </div>
            </div>
            <div class="publish"><!--发布/查询问答界面-->
                <label class="d-none" for="questionTextContent"></label>
                <textarea class="form-control text-area" id="questionTextContent"></textarea>
                <div class="myBtn d-flex">
                    <button onclick="clearQuestionContent()" class="btn btn-close btn-sm" title="清空内容"></button>
                    <button onclick="searchQuestion()" class="btn btn-primary btn-sm">搜索</button>
                    <button onclick="publishQuestion()" class="btn btn-primary btn-sm">发布</button>
                </div>
            </div>
        </div>
    </main>
</div>

<div th:replace="~{common/modal::noticeModal}"></div>
<div th:replace="~{common/modal::publishCommentOrAnswerModal}"></div>
<script src="../../static/js/bootstrap/bootstrap.bundle.min.js"></script>
<script src="../../static/js/jquery/jquery-3.6.0.min.js"></script>
<script src="../../static/plugins/jq-paginator/jq-paginator.min.js"></script>
<script src="../../static/js/my/common/noticeModal.js"></script>
<script src="../../static/js/my/common/header.js"></script>
<script src="../../static/js/my/common/formatTimeStamp.js"></script>
<script src="../../static/js/my/common/publishCommentOrAnswerModal.js"></script>
<script src="../../static/js/my/common/qAndA.js"></script>
<script src="../../static/js/my/qAndA.js"></script>
<script src="../../static/js/other/background.js"></script>
<script src="../../static/js/my/common/pagination.js"></script>
</body>
</html>